﻿<%@ WebHandler Language="C#" Class="View" %>

using System;
using System.Web;
using Ext.Net;
using System.Collections.Generic;
using System.Collections.Generic;
using NOAH.CMS.Repository;

public class View : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/json";
        //context.Response.Write("Hello World");

        int start = 0;
        int limit = 0;
        int count = 0;

        start = int.Parse(context.Request.QueryString["start"].ToString());
        limit = int.Parse(context.Request.QueryString["limit"].ToString());

        List<ImageCategory> imageCategories = new List<ImageCategory>();
        imageCategories = new ImageCategoryRepository().GetAll(start, limit, out count);
        context.Response.Write(string.Format("{{totalCount:{1},'imageCategories':{0}}}", JSON.Serialize(imageCategories), count));

    }

    public bool IsReusable
    {
        get
        {
            return true;
        }
    }

}